/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * RSScale.h
 *
 *  Created on: 2010/03/05
 *      Author: Alexandre Pires ( c.alexandre.pires@gmail.com )
 */

#ifndef RSSCALE_H_
#define RSSCALE_H_

#include "RSTransformationElement.h"

namespace Realsphere {

    class RSScale: public Realsphere::RSTransformationElement {
        Q_OBJECT
        public:
            RSScale ( const QString& rScopeId = QString::null );
            virtual ~RSScale();

        public:
            QVector3D               Proportion () const;

        public slots:
            void                    SetProportion ( const QVector3D& rProportion, bool rEmit = true );
            void                    SetProportion ( qreal rXProportion, qreal rYProportion, qreal rZProportion, bool rEmit = true );
            void                    ApplyScaling ( const QVector3D& rFactor );
            void                    ApplyScaling (  qreal rXFactor, qreal rYFactor, qreal rZFactor );

        signals:
            void                    ProportionChanged ( const QVector3D& rProportion );

        protected:
            void                    WriteElementData ( QXmlStreamWriter* rXmlWriter );
            void                    UpdateTransformation ();

        private:
            QVector3D               mProportion;

    };

}

#endif /* RSSCALE_H_ */
